package com.hibegin.http.server.util;

public class StringsUtil {
    public static String getHtmlStrByStatusCode(int statusCode, String errorMessage) {
    	if(errorMessage == null) {
    		return "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>" + statusCode + " " + StatusCodeUtil.getStatusCodeDesc(statusCode) + "</title></head><body><center><h1>" + statusCode + " " + StatusCodeUtil.getStatusCodeDesc(statusCode) + "</h1></center><hr><center>" + ServerInfo.getName() + "/" + ServerInfo.getVersion() + "</center></body></html>";
    	} else {
    		return "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>" + statusCode + " " + StatusCodeUtil.getStatusCodeDesc(statusCode) + "</title></head><body><center><h1>" + statusCode + " " + StatusCodeUtil.getStatusCodeDesc(statusCode) + "</h1></center><hr><center>" + errorMessage + "</center></body></html>";
        }
    }
}
